package com.qf.feign;

import com.qf.entity.Hotal;
import com.qf.entity.R;
import com.qf.entity.Room;
import com.qf.entity.RoomPrice;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("MICRO-HOTAL")
public interface HotalFeign {

    @RequestMapping("/hotal/insert")
    public R<Boolean> insert(@RequestBody Hotal hotal);

    @RequestMapping("/hotal/list")
    public R<List<Hotal>> list();

    @RequestMapping("/room/insert")
    R<Boolean> insertRoom(@RequestBody Room room);

    @RequestMapping("/room/list/{hid}")
    R<List<Room>> getRoom(@PathVariable Integer hid);

    @RequestMapping("/room/getPirce")
    R<List<RoomPrice>> getRoomPrice(@RequestParam Integer rid);

    @RequestMapping("/room/updateprice")
    R<Boolean> updatePrice(@RequestBody RoomPrice roomPrice);

    @RequestMapping("/room/getHotalId/{rid}")
    R<Integer> getHotalIdByRoomId(@PathVariable Integer rid);

    @RequestMapping("/room/getRoom/{rid}")
    R<Room> getRoomById(@PathVariable Integer rid);
}
